package org.example.finalsecurities.controller;

import org.example.finalsecurities.entity.Result;
import org.example.finalsecurities.service.CalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : [Pashm]
 * @version : [v1.0]
 */
@RestController
@RequestMapping("/api/calendar")
public class CalendarController {
    @Autowired
    private CalendarService calendarService;

    @RequestMapping("/all")
    public Result getAllCalendar(){

        return Result.success(calendarService.selectAll());
    }
    @RequestMapping("/fetch")
    public void fetch(){

        calendarService.fetchAndUpdateCalendar();
    }


}
